package com.example.survey_determination.controller;

import com.example.survey_determination.service.HumanInjuryInfoService;
import entity.human_injury_info;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (HumanInjuryInfo)表控制层
 *
 * @author makejava
 * @since 2022-01-10 23:59:34
 */
@CrossOrigin(methods = {RequestMethod.GET,RequestMethod.POST})
@RestController
@RequestMapping("humanInjuryInfo")
public class HumanInjuryInfoController {
    /**
     * 服务对象
     */
    @Resource
    private HumanInjuryInfoService humanInjuryInfoService;

    @RequestMapping("selectAll")
    public human_injury_info selectAll() {
        return humanInjuryInfoService.selectAll();
    }

    @RequestMapping("insert")
    public int insert(human_injury_info human_injury_info) {
        return this.humanInjuryInfoService.insert(human_injury_info);
    }

    @RequestMapping("queryById")
    public human_injury_info queryById(String claimMainId) {
        return this.humanInjuryInfoService.queryById(claimMainId);
    }



    /**
     * 删除数据
     *
     * @param id 主键
     * @return 删除是否成功
     */
    @DeleteMapping
    public ResponseEntity<Boolean> deleteById(Integer id) {
        return ResponseEntity.ok(this.humanInjuryInfoService.deleteById(id));
    }

}

